
// 文本字体调用函数
@mixin font-dpr($font-size) {
	font-size: $font-size;
	[data-dpr="2"] & {
		font-size: $font-size * 2;
	}
	[data-dpr="3"] & {
		font-size: $font-size * 3;
	}
}


// 小图标使用
@mixin img-dpr() {
	background-image: url(image.jpg); //默认
	[data-dpr="2"] & {
		background-image: url(image@2x.jpg); //两倍高清
	}
	[data-dpr="3"] & {
		background-image: url(image@3x.jpg); //三倍高清
	}
}

// 边框1px处理
@mixin border-dpr($side, $size, $color:#D9D9D9) {
	border-#{$side}: $size solid $color;
	[data-dpr="2"] & {
		border-#{$side}: $size * 2 solid $color;
	}
	[data-dpr="3"] & {
		border-#{$side}: $size * 3 solid $color;
	}
}

// 创建bg-image($url)函数
@mixin bg-image($url) {
    background-image: url($url + "@2x.png");
    @media(-webkit-min-device-pixel-ratio: 3),(min-device-pixel-ratio: 3) {
	    background-image: url($url + "@3x.png");
    } 
}

//暂时未用到
@function px2em($px, $base-font-size: 75px) {
    @if (unitless($px)) {
        @warn "Assuming #{$px} to be in pixels, attempting to convert it into pixels for you";
        @return px2em($px + 0px); // That may fail.
    } @else if (unit($px) == em) {
        @return $px;
    }
    @return ($px / $base-font-size) * 1em;
}

@mixin setTopLine($c: #C7C7C7) {
	content: " ";
	position: absolute;
	left: 0;
	top: 0;
	right: 0;
	height: 1px;
	border-top: 1px solid $c;
	color: $c;
	transform-origin: 0 0;
	transform: scaleY(0.5);
  }
  
  @mixin setBottomLine($c: #C7C7C7) {
	content: " ";
	position: absolute;
	left: 0;
	bottom: 0;
	right: 0;
	height: 1px;
	border-bottom: 1px solid $c;
	color: $c;
	transform-origin: 0 100%;
	transform: scaleY(0.5);
  }
  
  @mixin setLeftLine($c: #C7C7C7) {
	content: " ";
	position: absolute;
	left: 0;
	top: 0;
	width: 1px;
	bottom: 0;
	border-left: 1px solid $c;
	color: $c;
	transform-origin: 0 0;
	transform: scaleX(0.5);
  }
  
  @mixin setRightLine($c: #C7C7C7) {
	content: " ";
	position: absolute;
	right: 0;
	top: 0;
	width: 1px;
	bottom: 0;
	border-right: 1px solid $c;
	color: $c;
	transform-origin: 100% 0;
	transform: scaleX(0.5);
  }
  
  @mixin setLine($c: #C7C7C7) {
	  content: " ";
	  position: absolute;
	  left: 0;
	  top: 0;
	  width: 200%;
	  height: 1px;
	  border: 1px solid $c;
	  color: $c;
	  height: 200%;
	  transform-origin: left top;
	  transform: scale(0.5);
  }
